<template>
  <InitiatorActioners />
  <!-- 表单权限配置 -->
  <FormConfig :formData="formData" @update="updateFormConfig" />
</template>

<script setup lang="ts">
import type { FormConfig } from '../../types'
const { getFormData, updateFormData } = inject<{
  getFormData: () => FormConfig[]
  updateFormData: (data: FormConfig[]) => void
}>('nodeConfig', {
  getFormData: () => [],
  updateFormData: () => {}
})
const formData = ref<FormConfig[]>([])
// 更新表单权限数据
const updateFormConfig = ({ formData }: { formData: FormConfig[] }) => {
  updateFormData(formData)
}
onMounted(() => {
  formData.value = getFormData()
})
</script>
